function addLoadEvent(func){
	var oldonload=window.onload;
	if(typeof window.onload!='function'){
		window.onload=func;
	}else{
		window.onload=function(){
			oldonload();
			func();
		}
	}
}

function insertAfter(newElement,targetElment){
	var parent=targetElment.parentNode;
	if(parent.lastChild==targetElment){
		parent.appendChild(newElement);
	}else{
		parent.insertBefore(newElement,targetElment.nextSibling);
	}

}

function addClass(element,value){
	if(!element.className){
		element.className=value;
	}else{
		newClassName=element.className;
		newClassName+=" ";
		newClassName+=value;
		element.className=newClassName;
	}
}

function highlightPage(){
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById("navigation")) return false;
	var nav=document.getElementById("navigation");
	var links=nav.getElementsByTagName("a");
	for(var i=0;i<links.length;i++){
		var linkurl=links[i].getAttribute("href");
		var currenturl=window.location.href;
	    if(currenturl.indexOf(linkurl)!=-1){
	    	links[i].className="here";
	    	var linktext=links[i].lastChild.nodeValue.toLowerCase();
	        document.body.setAttribute("id",linktext);
	    }
	}
}